<?php  
	$linkImg = FILES_URL.'/developer/imgs/img110x110/';
	$linkSearch = $this->baseUrl($this->currentController.'/filter/type/search/key/1' );
	$count =  1;
?>
<div
	class="container">
	<div class="sub-center-container">
		<div class="slide-show">
		</div>
		<div class="img-right"></div>
		 <div class="clear"></div>
		<div class="toolbar">
			<a href="#">GAME </a> >> THÁCH ĐẤU
			<div class="sublink"  onclick="OnSubmitForm('<?php echo $this->baseUrl($this->currentController.'/filter/type/sortage/key/4') ?>')">
				<a href="#">10->12tuổi </a>
			</div>
			<div class="sublink" onclick="OnSubmitForm('<?php echo $this->baseUrl($this->currentController.'/filter/type/sortage/key/3') ?>')">
				<a href="#"> 7->9tuổi</a>
			</div>
			<div class="sublink" onclick="OnSubmitForm('<?php echo $this->baseUrl($this->currentController.'/filter/type/sortage/key/2') ?>')">
				<a href="#"> 4->6tuổi </a>
			</div>
			<div class="sublink" onclick="OnSubmitForm('<?php echo $this->baseUrl($this->currentController.'/filter/type/sortage/key/1') ?>')">
				<a href="#"> tất cả</a>
			</div>
		</div>
		
		<div class="sub-search">
			<div class="number-result">Có tất cả <b style="color: #2A9ABE;"><?php echo $this->totalItem?></b> trò chơi và ứng dụng</div>
			<div class="searchBar">
				
				<div class="button-clear" onclick="OnSubmitForm('<?php echo $this->baseUrl($this->currentController.'/filter/type/search/key/0') ?>')">
					<a style="color:white;float:left;text-align:center;" 
						href="#">clear</a>
				</div>
				<div class="button-search" onclick="OnSubmitForm('<?php echo $this->baseUrl($this->currentController.'/filter/type/search/key/1') ?>')">
					<a style="color:red"
						href="#"></a>
				</div>				
				
				<input type="text" name="keywords" placeholder="tìm kiếm ứng dụng" size="30" />
			</div>
		</div>
		<form name="appForm" method="post" action="" enctype="multipart/form-data">
		<div class="list-game">
			<ul>
				<div class="title-list-game">ỨNG DỤNG MỚI</div>
				<?php foreach($this->ItemsNew as $key=>$value){?>
				<li>
					<div class="thumbnail-game"></div>
						<img onclick="OnSubmitForm('<?php echo $this->baseUrl($this->currentController.'/article/id/'.$value['id'].'/typePlay/'.$this->arrParam['type']) ?>')" 
						alt="" src="<?php echo $linkImg.$value['link_img']?>" width="110" height="85" border="5" style="border-radius:5px">
					<div class="name-game">
						<?php echo $value['name_app']?>
					</div>
					<div class="star-game">
						<?php echo $value['star']?>
						sao
					</div>
					<div class="number-played">
						<?php echo $value['number_download']?>
						lượt
					</div>
				</li>
				<?php } ?>
				<div class="title-list-game">ỨNG DỤNG HAY</div>
				<?php foreach($this->Items as $key=>$value){ $count++; if($count>5){?>
				<li>
					<div class="thumbnail-game"> </div>
						<img onclick="OnSubmitForm('<?php echo $this->baseUrl($this->currentController.'/article/id/'.$value['id'].'/typePlay'.$this->arrParam['type']) ?>')" 
						alt="" src="<?php echo $linkImg.$value['link_img']?>" width="110" height="85" border="5" style="border-radius:5px"> 
					<div class="name-game">
						<?php echo $value['name_app']?>
					</div>
					<div class="star-game">
						<?php echo $value['star']?>
						sao
					</div>
					<div class="number-played">
						<?php echo $value['number_download']?>
						lượt
					</div>
				</li>
				<?php }} ?>


			</ul>
		</div>
		</form>
		<div class="clear"></div>

	</div>
	<!-- BEGIN: PAGINATION (FOOT) -->
	<div style="float:right;margin-right:280px;margin-top:30px;">
	<?php 
	$currentUrl = $this->baseUrl($this->currentController . '/challenge');
	echo $this->paginationControl($this->panigator,'Sliding','pagination.phtml',array('currentUrl'=>$currentUrl));
	?>
	</div>
	<!-- END: PAGINATION (FOOT) -->

	<?php  echo $this->render('index/categories/index.phtml')?>
</div>
</body>
</html>

<script>
    $(document).ready(function() {
        function togame(){
        	window.location.href = "http://localhost/terra/GameKhe/www/index.html";
        }
    });
</script>

